package com.xr.file.model.dto;

import cn.hutool.core.bean.BeanUtil;
import com.amazonaws.services.s3.model.PartSummary;
import com.xr.file.model.entity.SysUploadTask;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@ToString
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class TaskRecordDto extends SysUploadTask {

    /**
     * 已上传完的分片
     */
    private List<PartSummary> exitPartList;

    public static TaskRecordDto convertFromEntity(SysUploadTask task) {
        TaskRecordDto taskRecordDto = new TaskRecordDto();
        BeanUtil.copyProperties(task, taskRecordDto);
        return taskRecordDto;
    }

}
